import { createRouter,createWebHashHistory } from "vue-router";


// 引入页面
const Login = ()=> import("../views/Login.vue")
const UserCenter = ()=> import("../views/user-center/Index.vue")
const UserProfile = ()=> import("../views/user-center/Profile.vue")
const UserSettings = ()=> import("../views/user-center/Settings.vue")


// 路由的配置
const routeConfig = [
    {
        path:'/',
        redirect: '/login'
        // component: Login
    },
    {
        path:'/login',
        component:Login
    },
    {
        path:'/user',
        component: UserCenter,
        redirect:'/user/profile',
        children:[
            {
                path:'profile',
                component: UserProfile
            },
            {
                path:'settings',
                component: UserSettings
            }
        ]
    }
]

// 创建路由实例化对象
const router = createRouter({
    history: createWebHashHistory(),
    routes:routeConfig
})


export default router